package httpHandle

import (
	"github.com/gin-gonic/gin"
	"github.com/wzh200x/webServer/httpHandle/service"
	"github.com/wzh200x/webServer/middleware/response"
)

// 使用service包中定义的请求和响应结构
type GameConfigResponse service.GameConfigResponse
type GameConfig service.GameConfig

// HandleGetConfigs 处理获取游戏配置信息请求
func HandleGetConfigs(c *gin.Context) {
	success, err := response.GetResponseFuncs(c)

	// 调用service层获取游戏配置信息
	configs, errCode, errMsg := service.GetGameConfigs()
	if errCode > 0 {
		err(errCode, errMsg)
		return
	}

	// 返回游戏配置信息
	success(configs)
}
